package kr.co.kiso.usr.bd.ma.controller;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import kr.co.kiso.usr.bd.ma.service.BDMAService;
import kr.co.kiso.usr.bd.ma.vo.BDMAVo;
import kr.co.kiso.usr.common.BaseController;
import kr.co.kiso.usr.common.vo.CommonVo;
import kr.co.kiso.usr.utils.ConstValue;
import kr.co.kiso.usr.utils.PaginationInfo;
import kr.co.kiso.usr.utils.SMCommonUtil;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;

/**
 * 공통 게시판 관리
 * @author devhw
 *
 */
@Controller
@RequestMapping("/dsmgr/bd/ma/*")
public class BDMAController extends BaseController{
	@Autowired
	private BDMAService bdmaService;

	private final String FILE_PATH= ConstValue.TOP_UPLOAD+ "/bd/ma";

	Logger log = Logger.getLogger(getClass());
	
	/**
	 * 반환할 jsp 파일 정의
	 * @param vo
	 * @return
	 */
	public ModelAndView getJspFile(BDMAVo vo, HttpServletRequest req){
		ModelAndView mav = new ModelAndView();
		StringBuffer jspFile= new StringBuffer();
		
		if(vo.getBrd_type().equals("ABC")
				||
				vo.getBrd_type().equals("")
				){
			return mav;
		}else{
			//게시판
			String url = req.getServletPath();
			
			url = url.replaceAll(".do", "");
			
			String[] urlSplit = url.split("/");
			
			for(int i=2; i<= urlSplit.length ;i++){
				if(i==urlSplit.length){
					jspFile.append("/");
					jspFile.append(vo.getBrd_type());
					jspFile.append("/");
					jspFile.append(urlSplit[i-1]);
				}else{
					jspFile.append("/");
					jspFile.append(urlSplit[i-1]);
				}
			}
		}
		mav = new ModelAndView(jspFile.toString());
		return mav;
	}
	
	/**
	 * 게시판 조회
	 * @param vo
	 * @param req
	 * @param res
	 * @return
	 * @throws Exception
	 */
	@RequestMapping
	public ModelAndView bdma010Q(BDMAVo vo, HttpServletRequest req,
			HttpServletResponse res) throws Exception {
		isMember(req,res);
		ModelAndView mav = getJspFile(vo,req);
		
		if(vo.getSrc_content()!=null && !vo.getSrc_content().equals("")){
			vo.setSrc_content("%"+vo.getSrc_content()+"%");
		}
		if(vo.getSrc_reg_dt() !=null && !vo.getSrc_reg_dt().equals("")){
			vo.setSrc_reg_dt("%"+vo.getSrc_reg_dt()+"%");
		}
		if(vo.getSrc_reg_nm()!=null && !vo.getSrc_reg_nm().equals("")){
			vo.setSrc_reg_nm("%"+vo.getSrc_reg_nm()+"%");
		}
		
		// 페이징 시작
		PaginationInfo paginationInfo = new PaginationInfo();
		int currnetPageNo = vo.getCurrentPageNo() <= 1 ? 1 : (Integer) vo
				.getCurrentPageNo();
		vo.setCurrentPageNo(currnetPageNo);
		vo.setParamMap(requestPram2Map(req));
//		if (vo.getSch_title() != null && !vo.getSch_title().equals("")) {
//			vo.setSch_title("%" + vo.getSch_title() + "%");
//		}
		int iTotalCnt = bdmaService.bdma010Q_cnt(vo);
		vo.setTotalRecordCount(iTotalCnt);
		
		mav.addObject("noticeList", bdmaService.bdma011Q(vo));
		
		if(iTotalCnt>0){
			// 상위 코드목록
			mav.addObject("list", bdmaService.bdma010Q(vo));
			
			mav.addObject("pageHtml", vo.getToHtml("./bdma010Q.do"));
			mav.addObject("paginationInfo", vo);
		}

		return mav;
	}
	
	/**
	 * 게시판 등록 수정 폼 페이지
	 * @param vo
	 * @param req
	 * @param res
	 * @return
	 * @throws Exception
	 */
	@RequestMapping
	public ModelAndView bdma020Q(BDMAVo vo, HttpServletRequest req,
			HttpServletResponse res) throws Exception {
		isMember(req,res);
		ModelAndView mav = getJspFile(vo,req);


		return mav;
	}
	
	/**
	 * 게시판 등록 프로세스
	 * @param vo
	 * @param req
	 * @param res
	 * @return
	 * @throws Exception
	 */
	@RequestMapping
	public ModelAndView bdma020T(HttpServletRequest req, HttpServletResponse res,MultipartHttpServletRequest mRqst) throws Exception {
		isMember(req,res);
		
//		String mimedata = req.getParameter("content_html");
//
//		DEXTWebEditor DEXTMime = new DEXTWebEditor();
//
//		File folFile = new File(req.getSession().getServletContext().getRealPath("")+File.separator+ConstValue.EDITOR_FOLDER);
//		if(!folFile.exists()){
//			folFile.mkdirs();
//		}
//		
//		mimedata = DEXTMime.DEXTMimeDecode(mimedata, req.getSession().getServletContext().getRealPath("")+File.separator+ConstValue.EDITOR_FOLDER+File.separator, ConstValue.UPLOAD_URL);
//		BDMAVo vo = new BDMAVo();
//		
//		vo.setContent(mimedata);
//		
//		
//		MultiValueMap mulitFileMap = mRqst.getMultiFileMap();
//		
//		HashMap returnMap = new HashMap();
//		
//		
//		
//		SMCommonUtil util = new SMCommonUtil();
//		util.mapToBean(req.getParameterMap(), vo);
//		
//		ModelAndView mav = new ModelAndView("redirect:./bdma010Q.do?brd_type="+vo.getBrd_type());
//	
//		String usr_file_path= FILE_PATH;
//		//첨부파일전송
//		String[] files = {"file_name"};
//		Map fileMap = util.getFileInfo(mulitFileMap, mRqst.getSession().getServletContext().getRealPath(""),usr_file_path,true, files);
//		
//		if("Y".equals((String)fileMap.get("error_yn"))){
//			returnMap.put("error_msg", fileMap.get("error_msg"));
//			mav.addObject("map",returnMap);
//			return mav;
//		}
//		
//		List fileList  = new ArrayList();
//		for(int i =0; i<files.length ; i++){
//			if(null!=fileMap.get("file_name_nm")){
//				Map map = new HashMap();
//				map.put("file_nm", fileMap.get("file_name_nm"));
//				map.put("p_file_nm", fileMap.get("file_name"));
//				fileList.add(map);
//			}
//		}
//		
//		vo.setFileList(fileList);
//		//게시판 저장
//		bdmaService.bdma020T(vo);
		
		return null; 
	}
	
	/**
	 * ajax 파일업로드 게시판 수정
	 * @param req
	 * @param res
	 * @param mRqst
	 * @return
	 * @throws Exception
	 */
	@RequestMapping
	public ModelAndView bdma022T(BDMAVo vo,HttpServletRequest req, HttpServletResponse res) throws Exception {
		isMember(req,res);
//		String mimedata = req.getParameter("content_html");
//
//		DEXTWebEditor DEXTMime = new DEXTWebEditor();
//
//		File folFile = new File(req.getSession().getServletContext().getRealPath("")+File.separator+ConstValue.EDITOR_FOLDER);
//		if(!folFile.exists()){
//			folFile.mkdirs();
//		}
//		
//		mimedata = DEXTMime.DEXTMimeDecode(mimedata, req.getSession().getServletContext().getRealPath("")+File.separator+ConstValue.EDITOR_FOLDER+File.separator, ConstValue.UPLOAD_URL);
//		
//		vo.setContent(mimedata);
//		
//		HashMap returnMap = new HashMap();
//		
////		SMCommonUtil util = new SMCommonUtil();
////		util.mapToBean(req.getParameterMap(), vo);
//		
//		ModelAndView mav = new ModelAndView("redirect:./bdma010Q.do?brd_type="+vo.getBrd_type());
//	
//		List fileList  = new ArrayList();
//		//ajax파일전송 시작
//		String[] cFiles = vo.getcFiles();
//		String[] p_cFiles = vo.getP_cFiles();
//		String[] cFiles_size = vo.getcFiles_size();
//		//ajax 파일전송 끝
//		
//		
//
//		if(cFiles!=null){
//			for(int i=0; i< cFiles.length; i++){
//				Map map = new HashMap();
//				map.put("file_nm", cFiles[i]);
//				map.put("p_file_nm", p_cFiles[i]);
//				map.put("file_size", cFiles_size[i]);
//				
//				fileList.add(map);
//			}
//		}
//		vo.setFileList(fileList);
//		//게시판 저장
//		bdmaService.bdma020T(vo);
		
		return null; 
	}


	/**
	 * ajax 파일 전송
	 * @param req
	 * @param res
	 * @param mRqst
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping
	public ModelAndView bdma021T(HttpServletRequest req, HttpServletResponse res,MultipartHttpServletRequest mRqst) throws Exception {
		isMember(req,res);
		ModelAndView mav = new ModelAndView("/common/toJson");
		Map returnMap = new HashMap();
		SMCommonUtil util = new SMCommonUtil();

		MultiValueMap mulitFileMap =  mRqst.getMultiFileMap();
		
		
		String usr_file_path= FILE_PATH+"/tmp";
		
		//첨부파일전송
		String[] files = {"cFile"};
		Map fileMap = util.getFileInfo(mulitFileMap, mRqst.getSession().getServletContext().getRealPath(""),usr_file_path,true, files);
		
		if("Y".equals((String)fileMap.get("error_yn"))){
			returnMap.put("error_msg", fileMap.get("error_msg"));
			mav.addObject("map",returnMap);
			return mav;
		}
		
		for(int i =0; i<files.length ; i++){
			if(null!=fileMap.get("cFile")){
				returnMap.put("file_nm", fileMap.get("cFile_nm"));
				returnMap.put("p_file_nm", fileMap.get("cFile"));
				returnMap.put("p_file_sz", fileMap.get("cFile_sz"));
			}
		}
		returnMap.put("error_yn", "N");
		
		//첨부파일전송
		String[] files2 = {"cFile2"};
		Map fileMap2 = util.getFileInfo(mulitFileMap, mRqst.getSession().getServletContext().getRealPath(""),usr_file_path,false, files2);
		
		if("Y".equals((String)fileMap2.get("error_yn"))){
			returnMap.put("error_msg", fileMap2.get("error_msg"));
			mav.addObject("map",returnMap);
			return mav;
		}
		
		for(int i =0; i<files2.length ; i++){
			if(null!=fileMap2.get("cFile2")){
				returnMap.put("file_nm", fileMap2.get("cFile2_nm"));
				returnMap.put("p_file_nm", fileMap2.get("cFile2"));
				returnMap.put("p_file_sz", fileMap2.get("cFile2_sz"));
			}
		}
		returnMap.put("error_yn", "N");
				
		mav.addObject("map",returnMap) ;
		return mav;
	}
	
	/**
	 * 게시판 수정 프로세스
	 * @param vo
	 * @param req
	 * @param res
	 * @return
	 * @throws Exception
	 */
	@RequestMapping
	public ModelAndView bdma030t(CommonVo vo, HttpServletRequest req,
			HttpServletResponse res) throws Exception {
		isMember(req,res);
		ModelAndView mav = new ModelAndView();


		return mav;
	}
	
	/**
	 * 게시판 삭제 프로세스
	 * @param vo
	 * @param req
	 * @param res
	 * @return
	 * @throws Exception
	 */
	@RequestMapping
	public ModelAndView bdma040t(BDMAVo vo, HttpServletRequest req,HttpServletResponse res) throws Exception {
		isMember(req,res);
		ModelAndView mav = new ModelAndView("redirect:./bdma010Q.do?brd_type="+vo.getBrd_type());
		
		List delList = new ArrayList();
		for(int i = 0; i < vo.getDel_seq().length; i++){
			delList.add(vo.getDel_seq()[i]);
//			dao.bdma021T(vo);
		}
		vo.setDel_list(delList);
		
		//기존 파일 삭제
		List delListFile = bdmaService.bdma040Q(vo);
		for(int i=0;i<delListFile.size();i++){
			Map map = (Map) delListFile.get(i);
			if(map.get("M_FILE_NM")!=null){
				File delFile = new File(req.getSession().getServletContext().getRealPath("")+(String)map.get("M_FILE_NM"));
				if(delFile.isFile()){
					delFile.delete();
				}	
			}
		}
		
		bdmaService.bdma041t(vo);
		bdmaService.bdma042t(vo);
		bdmaService.bdma043t(vo);
		
		return mav;
	}
	
	/**
	 * 게시판글 상세조회
	 * @param vo
	 * @param req
	 * @param res
	 * @return
	 * @throws Exception
	 */
	@RequestMapping
	public ModelAndView bdma050Q(BDMAVo vo, HttpServletRequest req,
			HttpServletResponse res) throws Exception {
		isMember(req,res);
		ModelAndView mav = getJspFile(vo,req);
		
		mav.addObject("map",bdmaService.bdma050Q(vo));
		mav.addObject("fileList",bdmaService.bdma051Q(vo));
		mav.addObject("fileList",bdmaService.bdma051Q(vo));
		mav.addObject("nextInfo", bdmaService.bdma052Q(vo));

		return mav;
	}

	/**
	 * 수정화면
	 * @param vo
	 * @param req
	 * @param res
	 * @return
	 * @throws Exception
	 */
	@RequestMapping
	public ModelAndView bdma060Q(BDMAVo vo, HttpServletRequest req,
			HttpServletResponse res) throws Exception {
		isMember(req,res);
		ModelAndView mav = getJspFile(vo,req);
		
		mav.addObject("map",bdmaService.bdma050Q(vo));
		mav.addObject("fileList",bdmaService.bdma051Q(vo));

		return mav;
	}
	
	/**
	 * 게시판 수정 프로세스
	 * @param req
	 * @param res
	 * @param mRqst
	 * @return
	 * @throws Exception
	 */
	@RequestMapping
	public ModelAndView bdma060T(HttpServletRequest req, HttpServletResponse res,MultipartHttpServletRequest mRqst) throws Exception {
		isMember(req,res);
//
//		String mimedata = req.getParameter("content_html");
//
//		DEXTWebEditor DEXTMime = new DEXTWebEditor();
//
//		File folFile = new File(req.getSession().getServletContext().getRealPath("")+File.separator+ConstValue.EDITOR_FOLDER);
//		if(!folFile.exists()){
//			folFile.mkdirs();
//		}
//		
//		mimedata = DEXTMime.DEXTMimeDecode(mimedata, req.getSession().getServletContext().getRealPath("")+File.separator+ConstValue.EDITOR_FOLDER+File.separator, ConstValue.UPLOAD_URL);
//		BDMAVo vo = new BDMAVo();
//		
//		vo.setContent(mimedata);
//		
//		MultiValueMap mulitFileMap = mRqst.getMultiFileMap();
//		
//		HashMap returnMap = new HashMap();
//		
//		SMCommonUtil util = new SMCommonUtil();
//		util.mapToBean(req.getParameterMap(), vo);
//		
//		//기존 파일 삭제
//		if(vo.getFile_seq_nos()!=null){
//			List delList = new ArrayList();
//			for(int i =0; i< vo.getFile_seq_nos().length;i++){
//				//파일 삭제하는 부분 추가 해야함
//				delList.add(vo.getFile_seq_nos()[i]);
//			}	
//			vo.setDel_list(delList);
//			List delListFile=  bdmaService.bdma061Q(vo);
//			for(int i=0; i< delListFile.size();i++){
//				Map map = (Map) delListFile.get(i);
//				if(map.get("M_FILE_NM")!=null){
//					File delFile = new File(req.getSession().getServletContext().getRealPath("")+(String)map.get("M_FILE_NM"));
//					if(delFile.isFile()){
//						delFile.delete();
//					}	
//				}
//			}
//			//디비 삭제
//			bdmaService.bdma062Q(vo);
//		}
//		
//		
//		ModelAndView mav = new ModelAndView("redirect:./bdma010Q.do?brd_type="+vo.getBrd_type()+"&currentPageNo="+vo.getCurrentPageNo());
//	
//		String usr_file_path= FILE_PATH;
//		//첨부파일전송
//		String[] files = {"file_name"};
//		Map fileMap = util.getFileInfo(mulitFileMap, mRqst.getSession().getServletContext().getRealPath(""),usr_file_path,true, files);
//		
//		if("Y".equals((String)fileMap.get("error_yn"))){
//			returnMap.put("error_msg", fileMap.get("error_msg"));
//			mav.addObject("map",returnMap);
//			return mav;
//		}
//		
//		List fileList  = new ArrayList();
//		for(int i =0; i<files.length ; i++){
//			if(null!=fileMap.get("file_name_nm")){
//				Map map = new HashMap();
//				map.put("file_nm", fileMap.get("file_name_nm"));
//				map.put("p_file_nm", fileMap.get("file_name"));
//				fileList.add(map);
//			}
//		}
//		
//		vo.setFileList(fileList);
//
//		//게시판 수정
//		bdmaService.bdma060T(vo);
		
		return null; 
	}
	
	/**
	 * ajax 개시판 수정
	 * @param req
	 * @param res
	 * @param mRqst
	 * @return
	 * @throws Exception
	 */
	@RequestMapping
	public ModelAndView bdma061T(BDMAVo vo, HttpServletRequest req, HttpServletResponse res) throws Exception {
		isMember(req,res);
//
//		String mimedata = req.getParameter("content_html");
//
//		DEXTWebEditor DEXTMime = new DEXTWebEditor();
//
//		File folFile = new File(req.getSession().getServletContext().getRealPath("")+File.separator+ConstValue.EDITOR_FOLDER);
//		if(!folFile.exists()){
//			folFile.mkdirs();
//		}
//		List delList = new ArrayList();
//		delList.add(vo.getBrd_seq_no());
//		vo.setDel_list(delList);
//		
//		mimedata = DEXTMime.DEXTMimeDecode(mimedata, req.getSession().getServletContext().getRealPath("")+File.separator+ConstValue.EDITOR_FOLDER+File.separator, ConstValue.UPLOAD_URL);
//		
//		vo.setContent(mimedata);
//		
//		HashMap returnMap = new HashMap();
////		
////		SMCommonUtil util = new SMCommonUtil();
////		util.mapToBean(req.getParameterMap(), vo);
//		
//		//기존 파일 삭제
//		bdmaService.bdma042t(vo);
//		
//		
//		ModelAndView mav = new ModelAndView("redirect:./bdma010Q.do?brd_type="+vo.getBrd_type()+"&currentPageNo="+vo.getCurrentPageNo());
//
//		List fileList  = new ArrayList();
//		//ajax파일전송 시작
//		String[] cFiles = vo.getcFiles();
//		String[] p_cFiles = vo.getP_cFiles();
//		String[] cFiles_size = vo.getcFiles_size();
//		//ajax 파일전송 끝
//		
//		
//
//		if(cFiles!=null){
//			for(int i=0; i< cFiles.length; i++){
//				Map map = new HashMap();
//				map.put("file_nm", cFiles[i]);
//				map.put("p_file_nm", p_cFiles[i]);
//				map.put("file_size", cFiles_size[i]);
//				
//				fileList.add(map);
//			}
//		}
//		vo.setFileList(fileList);
//
//		//게시판 수정
//		bdmaService.bdma060T(vo);
		
		return null; 
	}
	
	/**
	 * 답글 기능
	 * @param vo
	 * @param req
	 * @param res
	 * @return
	 * @throws Exception
	 */
	@RequestMapping
	public ModelAndView bdma070Q(BDMAVo vo, HttpServletRequest req,
			HttpServletResponse res) throws Exception {
		isMember(req,res);
		ModelAndView mav = getJspFile(vo,req);
		
		mav.addObject("map",bdmaService.bdma050Q(vo));

		return mav;
	}
	
	/**
	 * 답글 프로세스 
	 * @param vo
	 * @param req
	 * @param res
	 * @return
	 * @throws Exception
	 */
	@RequestMapping
	public ModelAndView bdma070T(BDMAVo vo, HttpServletRequest req,
			HttpServletResponse res) throws Exception {
		isMember(req,res);
//
//		String mimedata = req.getParameter("content_html");
//
//		DEXTWebEditor DEXTMime = new DEXTWebEditor();
//
//		File folFile = new File(req.getSession().getServletContext().getRealPath("")+File.separator+ConstValue.EDITOR_FOLDER);
//		if(!folFile.exists()){
//			folFile.mkdirs();
//		}
//		
//		mimedata = DEXTMime.DEXTMimeDecode(mimedata, req.getSession().getServletContext().getRealPath("")+File.separator+ConstValue.EDITOR_FOLDER+File.separator, ConstValue.UPLOAD_URL);
//		vo.setContent(mimedata);
//		
//		ModelAndView mav = new ModelAndView("redirect:./bdma010Q.do?brd_type="+vo.getBrd_type()+"&currentPageNo="+vo.getCurrentPageNo());
//		vo.setBrd_depth(vo.getBrd_depth()+"_");
//		Map map = bdmaService.bdma071Q(vo);
//		String brdDepth = (String)map.get("BRDDEPTH");
//		vo.setBrd_seq_no(Long.parseLong(String.valueOf(map.get("MAXNUM"))));
//		if(brdDepth==null || brdDepth.equals("")){
//			vo.setBrd_depth(vo.getBrd_depth().replaceAll("_", "z"));
//		}else{
//			ToJinsu jinsu = new ToJinsu();
//			String num = brdDepth.substring( brdDepth.length()-1,brdDepth.length());
//			int iNum = Integer.parseInt( jinsu.jinsuToDec(num));
//			iNum--;
//			
//			vo.setBrd_depth(vo.getBrd_depth().replaceAll("_", "")+jinsu.getJinsu(Integer.toString(iNum) ));
//			
//		}
//		
//		bdmaService.bdma070T(vo);

		return null;
	}
	
	/**
	 * ajax 답글 프로세스
	 * @param vo
	 * @param req
	 * @param res
	 * @return
	 * @throws Exception
	 */
	@RequestMapping
	public ModelAndView bdma071T(BDMAVo vo, HttpServletRequest req,
			HttpServletResponse res) throws Exception {
		isMember(req,res);
//
//		String mimedata = req.getParameter("content_html");
//
//		DEXTWebEditor DEXTMime = new DEXTWebEditor();
//
//		File folFile = new File(req.getSession().getServletContext().getRealPath("")+File.separator+ConstValue.EDITOR_FOLDER);
//		if(!folFile.exists()){
//			folFile.mkdirs();
//		}
//		
//		mimedata = DEXTMime.DEXTMimeDecode(mimedata, req.getSession().getServletContext().getRealPath("")+File.separator+ConstValue.EDITOR_FOLDER+File.separator, ConstValue.UPLOAD_URL);
//		vo.setContent(mimedata);
//		
//		ModelAndView mav = new ModelAndView("redirect:./bdma010Q.do?brd_type="+vo.getBrd_type()+"&currentPageNo="+vo.getCurrentPageNo());
//		vo.setBrd_depth(vo.getBrd_depth()+"_");
//		Map map = bdmaService.bdma071Q(vo);
//		String brdDepth = (String)map.get("BRDDEPTH");
//		vo.setBrd_seq_no(Long.parseLong(String.valueOf(map.get("MAXNUM"))));
//		if(brdDepth==null || brdDepth.equals("")){
//			vo.setBrd_depth(vo.getBrd_depth().replaceAll("_", "0"));
//		}else{
//			ToJinsu jinsu = new ToJinsu();
//			String num = brdDepth.substring( brdDepth.length()-1,brdDepth.length());
//			int iNum = Integer.parseInt( jinsu.jinsuToDec(num));
//			iNum++;
//			
//			vo.setBrd_depth(vo.getBrd_depth().replaceAll("_", "")+jinsu.getJinsu(Integer.toString(iNum) ));
//			
//		}
//		
//		bdmaService.bdma070T(vo);

		return null;
	}
	
	
	/**
	 * 사용자 페이지 숨김, 보이기 처리
	 * @param vo
	 * @param req
	 * @param res
	 * @return
	 * @throws Exception
	 */
	@RequestMapping
	public ModelAndView bdma090T(BDMAVo vo, HttpServletRequest req,
			HttpServletResponse res) throws Exception {

		ModelAndView mav = new ModelAndView("redirect:./bdma010Q.do?brd_type="+vo.getBrd_type()+"&currentPageNo="+vo.getCurrentPageNo());
		
		bdmaService.bdma090T(vo);
		
		return mav;
	}
}
